<template>
  <div class="my" v-if="Info">
    <div class="top">
      <div class="top1">
        <div class="top-left">
          <div class="top-name">续命咖啡</div>
          <div class="top-intro">面试不求人</div>
        </div>
        <img src="../../../assets/logo.png" alt="" class="top-right" />
      </div>
      <ul class="top2">
        <li class="top-item">
          <div class="top-num">298</div>
          <div class="top-txt">累计题目</div>
        </li>
        <li class="top-item">
          <div class="top-num">{{Info.collectQuestions.length}}</div>
          <div class="top-txt">收藏题目</div>
        </li>
        <li class="top-item">
          <div class="top-num">{{Info.correctQuestions.length}}</div>
          <div class="top-txt">我的错题</div>
        </li>
        <li class="top-item">
          <div class="top-num">298</div>
          <div class="top-txt">正确率</div>
        </li>
      </ul>
      <div class="top3">
        <!-- <van-cell is-link>
          <template #icon>
            <i class="iconfont">&#xe64d;</i>
          </template>
          <template #title>
            <div class="title">
              我的岗位
            </div>
          </template>
          <template #default>
            <div class="value">
              产品经理
            </div>
          </template>
        </van-cell> -->
        <mycell title="我的岗位" value="产品经理" icon="&#xe64d;"></mycell>
      </div>
    </div>
    <div class="content">
      <div class="middle">
        <h3 class="m1">面经数据</h3>
        <div class="item-middle">
          <div class="item">
            <div class="i1">昨日阅读<span>+{{Info.shareData.read.yesterday}}</span></div>
            <div class="i2">{{Info.shareData.read.total}}</div>
            <div class="i3">阅读总数</div>
          </div>
          <div class="item">
            <div class="i1">昨日或赞<span>+{{Info.shareData.star.yesterday}}</span></div>
            <div class="i2">{{Info.shareData.star.total}}</div>
            <div class="i3">获赞总数</div>
          </div>
          <div class="item">
            <div class="i1">昨日新增<span>+{{Info.shareData.comment.yesterday}}</span></div>
            <div class="i2">{{Info.shareData.comment.total}}</div>
            <div class="i3">评论总数</div>
          </div>
        </div>
      </div>
      <div class="buttom">
        <mycell icon="&#xe655;" title="我的面经分享" value="21"></mycell>
        <mycell icon="&#xe656;" title="我的消息" value="98"></mycell>
        <mycell icon="&#xe654;" title="收藏的题库" value="21"></mycell>
        <mycell icon="&#xe648;" title="收藏的企业" value="98"></mycell>
        <mycell icon="&#xe64f;" title="我的错题" value="21"></mycell>
        <mycell icon="&#xe649;" title="收藏的面试经验" value="98"></mycell>
      </div>
    </div>
  </div>
</template>
<script>
// 导入组件
import mycell from './mycell'
// 导入api
import { auInfo } from '@/api/my.js'
export default {
  // 注册组件
  components: {
    mycell
  },
  data () {
    return {
      Info: ''
    }
  },
  methods: {},
  mounted () {
    document.body.style.backgroundColor = '#f7f4f5'
  },
  beforeDestroy () {
    document.body.style.backgroundColor = '#fff'
  },
  async created () {
    console.log(555)
    const res = await auInfo()
    console.log(res)
    this.Info = res.data.data
  }
}
</script>
<style lang="less" scoped>
.my {
  .top {
    background: linear-gradient(45deg, #ce0031, #b8002c);
    padding: 0 @p15;
    position: relative;
    .top1 {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 31px 0 10px;
      .top-left {
        .top-name {
          font-size: 21px;
          font-family: PingFangSC, PingFangSC-Semibold;
          font-weight: 600;
          text-align: left;
          color: #ffffff;
          line-height: 30px;
          letter-spacing: 0px;
          padding-bottom: 6px;
        }
        .top-intro {
          opacity: 0.7;
          font-size: 12px;
          font-family: PingFangSC, PingFangSC-Regular;
          font-weight: 400;
          text-align: left;
          color: #ffffff;
          line-height: 16px;
          letter-spacing: 0px;
        }
      }
      .top-right {
        width: 50px;
        height: 50px;
        border: 3px solid rgba(255, 255, 255, 0.38);
        border-radius: 50%;
      }
    }
    .top2 {
      display: flex;
      justify-content: space-between;
      padding-bottom: 50px;

      .top-item {
        text-align: center;
        .top-num {
          font-size: 21px;
          font-family: DINAlternate, DINAlternate-Bold;
          font-weight: 700;
          text-align: center;
          color: #ffffff;
          line-height: 24px;
          letter-spacing: 0px;
          padding-bottom: 6px;
        }
        .top-txt {
          opacity: 0.7;
          font-size: 12px;
          font-family: PingFangSC, PingFangSC-Regular;
          font-weight: 400;
          text-align: center;
          color: #ffffff;
          line-height: 16px;
          letter-spacing: 0px;
          padding-bottom: 6px 0 55px;
        }
      }
    }
    .top3 {
      position: absolute;
      bottom: -27px;
      left: 0px;
      width: 100%;
      height: 55px;
      padding-left: 15px;
      padding-right: 15px;
    }
  }
  .content {
    margin-top: 26px;
    padding: 0 @p15;

    .middle {
      padding: 15px;
      background-color: #fff;
      .m1 {
        font-size: 14px;
        font-family: PingFangSC, PingFangSC-Semibold;
        font-weight: 600;
        text-align: left;
        color: #181a39;
        line-height: 20px;
        letter-spacing: 0px;
      }
      .item-middle {
        display: flex;
        justify-content: space-between;
        padding-top: 10px;
        .item {
          text-align: center;
          .i1 {
            font-size: 12px;
            font-family: PingFangSC, PingFangSC-Regular;
            font-weight: 400;
            text-align: center;
            color: #b4b4bd;
            line-height: 14px;
            letter-spacing: 0px;
            span {
              color: #2cc4db;
            }
          }
          .i2 {
            font-size: 21px;
            font-family: DINAlternate, DINAlternate-Bold;
            font-weight: 700;
            text-align: center;
            color: #181a39;
            line-height: 24px;
            letter-spacing: 0px;
            padding: 10px 0 6px;
          }
          .i3 {
            font-size: 12px;
            font-family: PingFangSC, PingFangSC-Regular;
            font-weight: 400;
            text-align: center;
            color: #545671;
            line-height: 16px;
            letter-spacing: 0px;
          }
        }
      }
    }
    .buttom {
      margin-top: 10px;
    }
  }
}
</style>
